﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ForzaGT3.Data;

namespace ForzaGT3.Controllers
{
    public partial class CircuitController : Controller
    {
        //
        // GET: /Circuit/

        public class TrackPosition
        {
            public string Latitude { get; set; }
            public string Longitude { get; set; }
        }

        public virtual JsonResult GetById(Guid Id)
        {
            Circuit circuit = Circuit.GetById(Id);
            TrackPosition pos = new TrackPosition();
            if (circuit != null)
            {
                pos.Latitude = circuit.Latitude;
                pos.Longitude = circuit.Longitude;
            }
            return Json(pos, JsonRequestBehavior.AllowGet);
        }

    }
}
